package ihm.actions;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class OpenFrame implements ActionListener{
  
  private String frameClassName ;
  public OpenFrame(String frameClassName)
  {
    this.frameClassName = frameClassName;
  }
  @Override
  public void actionPerformed(ActionEvent e) {
    try {
      System.out.println("[OpenFrame] - Action performed "+frameClassName+" - Debut");
      Class.forName(frameClassName).newInstance();
    } catch (InstantiationException e1) {
      e1.printStackTrace();
    } catch (IllegalAccessException e1) {
      e1.printStackTrace();
    } catch (ClassNotFoundException e1) {
      e1.printStackTrace();
    }
    System.out.println("[OpenFrame] - Action performed "+frameClassName+" - Fin");

  }
  
}
